package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.zzyl.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "会员项目接口")
public class MemberProjectController extends BaseController
{

    @Autowired
    private INursingProjectService nursingProjectService;


    @GetMapping("/page")
    @ApiOperation("分页查询")
    public TableDataInfo<NursingProject> page(NursingProject nursingProject) {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }
    @GetMapping("/{id}")
    @ApiOperation("查询")
    public AjaxResult getById(@PathVariable Long id)
    {
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return AjaxResult.success(nursingProject);

    }

}
